class PublicData {
	static userName = 'userName';
	static pwd = 'pwd';
	static uid = 'uid';
	static ishy = 'ishy';
	static wx = 'wx';
	static qq = 'qq';
	static hy_time = 'hy_time';
	static phone = 'phone';
	static UserData = {
		userName: null,
		pwd: null,
		uid: null,
		ishy: 0,
		wx: null,
		qq: null,
		hy_time: null,
		phone: null,
	}
	static saveUserwxQQ(wx,qq) {
		uni.setStorageSync(this.wx, wx);
		uni.setStorageSync(this.qq, qq);
		console.log("saveUser666666666666666666",wx);
	}
	static saveUserdata(userData) {

		if (userData != null) {
			uni.setStorageSync(this.userName, userData.USERNAME);
			uni.setStorageSync(this.pwd, userData.PASSWORD);
			uni.setStorageSync(this.uid, userData.USER_ID);
			uni.setStorageSync(this.ishy, userData.ROLE_ID);

			uni.setStorageSync(this.wx, userData.WXHM);
			uni.setStorageSync(this.qq, userData.QQHM);
			uni.setStorageSync(this.hy_time, userData.hy_time);
			uni.setStorageSync(this.phone, userData.PHONE);
		} else {
			uni.setStorageSync(this.userName, null);
			uni.setStorageSync(this.pwd, null);
			uni.setStorageSync(this.uid, null);
			uni.setStorageSync(this.ishy, 0);


			uni.setStorageSync(this.wx, null);
			uni.setStorageSync(this.qq, null);
			uni.setStorageSync(this.hy_time, null);
			uni.setStorageSync(this.phone, null);
		}
	}

	static getUserdata() {
		this.UserData.userName = uni.getStorageSync(this.userName);
		this.UserData.pwd = uni.getStorageSync(this.pwd);
		this.UserData.uid = uni.getStorageSync(this.uid);
		this.UserData.ishy = uni.getStorageSync(this.ishy);
		this.UserData.wx = uni.getStorageSync(this.wx);
		this.UserData.qq = uni.getStorageSync(this.qq);
		this.UserData.hy_time = uni.getStorageSync(this.hy_time);
		this.UserData.phone = uni.getStorageSync(this.phone);
		return this.UserData;

	}

}
export default PublicData;
